/**
 * jims
 */
package com.jims.master.modules.med.dao;

import com.jims.master.common.persistence.CrudDao;
import com.jims.master.common.persistence.annotation.MyBatisDao;
import com.jims.master.modules.med.entity.MedicalCardMaster;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 一卡通办理DAO接口
 * @author 陈晓阳
 * @version 2017-05-22
 */
@MyBatisDao
public interface MedicalCardMasterDao extends CrudDao<MedicalCardMaster> {
    /**
     * 根据卡号查询信息
     * @param medicalCardMaster
     * @return
     */
    public MedicalCardMaster findByCardNo(MedicalCardMaster medicalCardMaster);

    /**
     * 修改一卡通余额
     * @param medicalCardMaster
     * @return
     */
    public int updateBalance(MedicalCardMaster medicalCardMaster);

    /**
     * 根据idCard 查询病人挂失的余额大于0 的卡信息
     * @param medicalCardMaster
     * @return
     */
    public  MedicalCardMaster findByIdCard(MedicalCardMaster medicalCardMaster);

    /**
     * 充值挂失卡的余额信息
     * @param ids
     * @return
     */
    public int updateOldCard(@Param("ids")List<String> ids);

    /**
     * 退卡
     * @param medicalCardMaster
     * @return
     */
    public int returnCard(MedicalCardMaster medicalCardMaster);

    /**
     * 挂号退费
     * @param cardNo
     * @param charge
     * @return
     */
    public  int returnFee(@Param("cardNo") String cardNo,@Param("charge") String charge);


    public MedicalCardMaster getByClinicNo(@Param("clinicNo") String clinicNo);
}